package com.management.service.Impl;

import com.management.dao.SectionAndPostDao;
import com.management.po.SectionAndPost;
import com.management.service.SectionAndPostService;
import com.management.vo.SectionAndPostVO;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @category:
 * @author: cwsheng
 * @version: 1.0
 * @date: 2021/10/29 17:25
 */
@Service
public class SectionAndPostServiceImpl implements SectionAndPostService {
    @Resource
    SectionAndPostDao sectionAndPostDao;
    @Override
    public List<SectionAndPostVO> findAll() {
        return sectionAndPostDao.findAll();
    }

    @Override
    public List<SectionAndPostVO> findBySectionId(int sectionId) {
        return sectionAndPostDao.findBySectionId(sectionId);
    }

    @Override
    public SectionAndPostVO findBySectionAndPostId(int sectionAndPostId) {
        return sectionAndPostDao.findBySectionAndPostId(sectionAndPostId);
    }

    @Override
    public boolean add(SectionAndPost sectionAndPost) {
        return sectionAndPostDao.add(sectionAndPost)>0?true:false;
    }

    @Override
    public boolean update(SectionAndPost sectionAndPost) {
        return sectionAndPostDao.update(sectionAndPost)>0?true:false;
    }

    @Override
    public boolean delete(int[] sectionAndPostIds) {
        return sectionAndPostDao.delete(sectionAndPostIds)>0?true:false;
    }

    @Override
    public SectionAndPostVO findBySectionPostId(int sectionId, int postId) {
        return sectionAndPostDao.findBySectionPostId(sectionId,postId);
    }
}
